/* eslint-disable */
// @ts-ignore
import request from '@/utils/request';
import { CustomRequestOptions } from '@/interceptors/request';

import * as API from './types';

/** 分页查询二维码 GET /qr_code */
export async function qrCodeGetQrCodePage({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.QRCodeGetQRCodePageParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelResponseDataListModelQRCodeModel_>(
    '/qr_code',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 编辑二维码 PUT /qr_code */
export async function qrCodeEditQrCode({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.QRCodeEditQRCodeParams;
  body: API.UpsertQRCOdeModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/qr_code', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增二维码 POST /qr_code */
export async function qrCodeAddQrCode({
  body,
  options,
}: {
  body: API.UpsertQRCOdeModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/qr_code', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除二维码 DELETE /qr_code */
export async function qrCodeDeleteQrCode({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.QRCodeDeleteQRCodeParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/qr_code', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
